<?php
// +----------------------------------------------------------------------
// | 跃飞 [ 将来的你一定会感激现在奋斗的自己 ]
// +----------------------------------------------------------------------
// | Author: 钟贵廷
// +----------------------------------------------------------------------
// | Author URI: https://git.oschina.net/yeafy
// +----------------------------------------------------------------------
// | weChat:gt845272922  qq:845272922
// +----------------------------------------------------------------------


namespace app\yeafy\singleton;


class Pdo
{
     private static $instance = null;

    /**
     * 不让new
     * Pdo constructor.
     */
    private function __construct()
    {
        echo '在这里实现使用单例实现pdo数据库连接';
    }

    /**
     * @desc:不让克隆
     * @author 钟贵廷
     * @WeChat gt845272922
     * @qq 845272922
     */
     private function __clone()
     {
     }


    /**
     * @desc:单例
     * @author 钟贵廷
     * @WeChat gt845272922
     * @qq 845272922
     * @return Pdo|null
     */
    public static function getInstance()
    {
        if(self::$instance === null)
        {
            self::$instance = new self;
        }
        return self::$instance;
    }
}